import { Status } from './dicts';

export const enum MenuType {
  subMenu = 1,
  group,
  page,
}

export interface Menu {
  key: string;
  parent: string;
  title: string;
  path?: string;
  type: MenuType;
  icon?: string;
  status: Status;
  createTime: Date;
  sort?: number;
  updateTime?: Date;
}
const createTime = new Date();
const updateTime = createTime;
export default <Menu[]>[
  {
    key: 'system',
    parent: '',
    title: '系统管理',
    path: '',
    icon: 'eos-icons:system-group',
    type: MenuType.subMenu,
    status: Status.enable,
    createTime,
    updateTime,
    sort: 1,
  },
  {
    key: 'system-user',
    parent: 'system',
    title: '用户管理',
    path: '/system/user',
    icon: '',
    type: MenuType.page,
    status: Status.enable,
    createTime,
    updateTime,
    sort: 1,
  },
  {
    key: 'system-user-uid',
    parent: 'system-user',
    title: '用户详情',
    path: '/system/user/:uid',
    icon: '',
    type: MenuType.page,
    status: Status.enable,
    createTime,
    updateTime,
    sort: 1,
  },
  {
    key: 'system-role',
    parent: 'system',
    title: '角色管理',
    path: '/system/role',
    icon: '',
    type: MenuType.page,
    status: Status.enable,
    createTime,
    updateTime,
    sort: 2,
  },
  {
    key: 'system-role-key',
    parent: 'system-role',
    title: '角色详情',
    path: '/system/role/:key',
    icon: '',
    type: MenuType.page,
    status: Status.enable,
    createTime,
    updateTime,
    sort: 1,
  },
  {
    key: 'system-menu',
    parent: 'system',
    title: '菜单管理',
    path: '/system/menu',
    icon: '',
    type: MenuType.page,
    status: Status.enable,
    createTime,
    updateTime,
    sort: 3,
  },
  {
    key: 'system-menu-key',
    parent: 'system-menu',
    title: '菜单详情',
    path: '/system/menu/:key',
    icon: '',
    type: MenuType.page,
    status: Status.enable,
    createTime,
    updateTime,
    sort: 1,
  },
  {
    key: 'system-menu-add',
    parent: 'system-menu',
    title: '新建菜单',
    path: '/system/menu/add',
    icon: '',
    type: MenuType.page,
    status: Status.enable,
    createTime,
    updateTime,
    sort: 1,
  },
  {
    key: 'system-dept',
    parent: 'system',
    title: '部门管理',
    path: '/system/dept',
    icon: '',
    type: MenuType.page,
    status: Status.disable,
    createTime,
    updateTime,
    sort: 4,
  },
  {
    key: 'system-dept-key',
    parent: 'system-dept',
    title: '部门详情',
    path: '/system/dept/:key',
    icon: '',
    type: MenuType.page,
    status: Status.disable,
    createTime,
    updateTime,
    sort: 1,
  },
];
